home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 16.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-07-04  |  2.7 KB  |  155 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. call close TempFile
  29.  
  30. Frames = (End - Start)+1
  31. j=0
  32. k=0
  33. TFrames = Frames
  34. TNum = 3
  35. if TFrames > 999 then TNum = 4
  36. if TFrames > 9999 then TNum = 5
  37. if Field = 1 then TFrames = Frames*2
  38. do i = Start to End
  39.     k = k + 1
  40.     call open TempFile,"RAM:VFXNums",W
  41.     call writeln TempFile,right(k,5,'0')
  42.     call writeln TempFile,right(Frames,5,'0')
  43.     call close TempFile
  44.     f=0
  45.     Redraw Off
  46.     j = j+ 1
  47.     call DoIt()
  48.     Redraw On
  49.     call SaveIt()
  50.         if Field = 1 then do
  51.             Redraw Off
  52.             j = j + 1
  53.             call DoIt()
  54.             Redraw On
  55.             call SaveIt()
  56.             end 
  57.     end
  58.     Undo On
  59. exit
  60.  
  61.  
  62. LoadA:
  63.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  64.         Undo On
  65.         exit
  66.         end
  67.     if IAType = 0 then do
  68.         LoadBuffer PicAName Force i
  69.         if Field = 1 then do
  70.             GetMain
  71.             parse var result Name Width Height Blah
  72.             if FieldSet = 0 then do
  73.                 Hook DeInterlace
  74.                 Scale Width Height
  75.                 end
  76.             if FieldSet = 1 then do
  77.                 Hook DeInterlace
  78.                 Swap
  79.                 Scale Width Height
  80.                 end
  81.             end
  82.         end
  83.     if IAType = 1 then do
  84.         LoadBuffer PicAName Force 1
  85.         end
  86.     if IAType = 2 then do
  87.         LoadBuffer PicAName Force
  88.         end
  89.     if IAType = 3 then do
  90.         LoadBuffer PicAName""right(i,TNum,'0') Force
  91.         end
  92. return
  93.  
  94.  
  95.  
  96. SaveIt:
  97.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  98.         Undo On
  99.         exit
  100.         end
  101.     if SaveType = 0 then do
  102.         call Switcher(TOSW)
  103.         call Switcher(MDV1)
  104.  
  105.         Render Go
  106.         if Field = 1 then
  107.                 call RecordAdd(SaveName,1,6,Compression)
  108.         else
  109.                 call RecordAdd(SaveName,2,6,Compression)
  110.         if j = TFrames then
  111.             call MakeIcon(SaveName,(Frames-10))
  112.         end
  113.  
  114.     if SaveType = 1 then do
  115.         if Field = 1 then do
  116.             f= f + 1
  117.             if f = 1 then
  118.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  119.             if f = 2 then do
  120.                 GetMain
  121.                 parse var result Name Width Height Blah
  122.                 Scale Width Height/2
  123.                 Swap
  124.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  125.                 Scale Width Height/2
  126.                 Hook Interlace
  127.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  128.                 f = 0
  129.                 end
  130.             end
  131.         else do
  132.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  133.             end    
  134.         end
  135.  
  136. return
  137.  
  138.  
  139.  
  140.  
  141. DoIt:
  142.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  143.         Undo On
  144.         exit
  145.         end
  146.     call LoadA()
  147.  
  148.     Hook "Hooks/Sys/SobelEdge"  
  149.     Hook "Hooks/Sys/Antique"  
  150.     Negative
  151.  
  152. return
  153.  
  154.  
  155.